// 独立拆分并集中管理跟用户操作业务相关的网络请求
import request from '../utils/request'
// 登录
export const userLoginApi = async (payload) => {
    return request.get('/users',{
        params:payload
    })
}
// 注册
export const userRegApi = async (payload) => {
    return request.post('/users',payload)
}


// 信息更新
export const userUpdateApi = async (id,payload) => {
    return request.put('/users',payload,{
        params:{id}
    })
}

// 角色新增
export const rolePostApi = async (payload) => {
    return request.post('/role',payload)
}

// 角色查询
export const roleGetApi = async (roleId) => {
    let params = roleId ? {'id':roleId} : {}
    return request.get('/role',{
        params
    })
}
// 角色更新
export const roleUpdateApi = async (id,payload) => {
    return request.put('/role',payload,{
        params:{id}
    })
}